class Emailer < ActionMailer::Base

  def password(password, email, name)

    @recipients   = email
    @from         = "APO Website <internet@apouiuc.com>"
    @subject      = "Your password was reset"
    @sent_on      = Time.now

    @body["message"] = "Hi #{name}, your new password is #{password} \nBe sure to change your password after you login so you don't forget it again!"

  end

  def sent(message, member, recipient)

    @recipients   = recipient['recipient'] + "@apouiuc.com"
    @from         = member.full_name + "<" + member.email + ">"
    @subject      = "Message to " + recipient['recipient'] + "@apouiuc.com"
    @sent_on      = Time.now

    @body["message"] = message

  end

  def signup(email, event)

    @recipients   = email
    @from         = "APO Website <waitlist@apouiuc.com>"
    @subject      = "You are now signed up for #{event.name}!"
    @sent_on      = Time.now

    @body["message"] = "Please show up to #{event.name} at #{event.meeting_place} on #{event.date.strftime("%A, %b %d at %I:%M %p")}.  For more details, please check the website.\n  Thank you!"

  end

end
